﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using TSqlServer;
/// <summary>
/// TAdMagazineIssue 的摘要说明
/// </summary>
public class TAdMagazineIssue:TData
{

    	//常量
  	const string CTableName="t_ad_magazine_issue";
    const string CKeyName = "issuecode";
    //与数据表字段对应的变量
    private string FMagCode ; 
        private string FNotice ; 
        private string FInputer ; 
        private DateTime FInput_Time ; 
        private string FIssueCode ; 
        private string FIssueNo ; 
        private DateTime FPubDate ; 
        private int FIssuePages ; 
        private decimal FPrice ; 
        private string FCover ; 
        private string FCoverTitle ; 
        private int FPrintQty ; 
	public TAdMagazineIssue()
	{
		//
		// TODO: 在此处添加构造函数逻辑
		//

        FTableName = CTableName;
        FKeyName = CKeyName;
	}

    public TAdMagazineIssue(string sid)
    {
    	FTableName = CTableName;
        FKeyName = CKeyName;
        FKeyValue = sid;
    }

    public override void Select()
    {
        string strSql = GetSelectString();
        TSqlDB oDB = new TSqlDB(strSql);
        if (!oDB.EOF)
        {

            FMagCode = oDB["MagCode"].ToString();
            FNotice = oDB["Notice"].ToString();
            FInputer = oDB["Inputer"].ToString();
            FInput_Time = oDB["Input_Time"].ToDateTime();
            FIssueCode = oDB["IssueCode"].ToString();
            FIssueNo = oDB["IssueNo"].ToString();
            FPubDate = oDB["PubDate"].ToDateTime();
            FIssuePages = oDB["IssuePages"].ToInt();
            FPrice = oDB["Price"].ToDecimal();
            FCover = oDB["Cover"].ToString();
            FCoverTitle = oDB["CoverTitle"].ToString();
            FPrintQty = oDB["PrintQty"].ToInt();
        }
        oDB.Free();
    }
    //插入新记录。
    public void Insert()
    {
        string ExSql ="'" +  FMagCode +  "','" + FIssueCode + "','" + FIssueNo + "','" + FPubDate + "','" + FIssuePages + "','" + FPrice + "','" + FCover + "','" + FCoverTitle + "','" + FPrintQty +"','" + FNotice + "','" + FInputer + "','" + FInput_Time +"'";
        base.Insert(ExSql);
    }
    //更新记录。
    public void Update()
    {
        string ExSql = "MagCode ='" + FMagCode + "', IssueCode ='" + FIssueCode + "', IssueNo ='" + FIssueNo + "', PubDate ='" + FPubDate + "', IssuePages ='" + FIssuePages + "', Price ='" + FPrice + "', Cover ='" + FCover + "', CoverTitle ='" + FCoverTitle + "', PrintQty ='" + FPrintQty  + "', Notice ='" + FNotice + "', Inputer ='" + FInputer + "', Input_Time ='" + FInput_Time + "'";
        base.Update(ExSql);
    }
    //改变状态,0=未验证,1=已通过验证
    //public void Update_status()
    //{
    //    string ExSql = "status=" + FStatus.ToString(); ;
    //    base.Update(ExSql);
    //}
    //静态，可以不用创建对象即可调用。
    public static void DeleteByID(string sID)
    {
        TData.DeleteByID(sID, CTableName, CKeyName);
    }


    public string MagCode
    {
        get
        {
            return FMagCode;
        }
        set
        {
            FMagCode = value;
        }
    }
    public string Notice
    {
        get
        {
            return FNotice;
        }
        set
        {
            FNotice = value;
        }
    }
    public string Inputer
    {
        get
        {
            return FInputer;
        }
        set
        {
            FInputer = value;
        }
    }
    public DateTime Input_Time
    {
        get
        {
            return FInput_Time;
        }
        set
        {
            FInput_Time = value;
        }
    }
    public string IssueCode
    {
        get
        {
            return FIssueCode;
        }
        set
        {
            FIssueCode = value;
        }
    }
    public string IssueNo
    {
        get
        {
            return FIssueNo;
        }
        set
        {
            FIssueNo = value;
        }
    }
    public DateTime PubDate
    {
        get
        {
            return FPubDate;
        }
        set
        {
            FPubDate = value;
        }
    }
    public int IssuePages
    {
        get
        {
            return FIssuePages;
        }
        set
        {
            FIssuePages = value;
        }
    }
    public decimal Price
    {
        get
        {
            return FPrice;
        }
        set
        {
            FPrice = value;
        }
    }
    public string Cover
    {
        get
        {
            return FCover;
        }
        set
        {
            FCover = value;
        }
    }
    public string CoverTitle
    {
        get
        {
            return FCoverTitle;
        }
        set
        {
            FCoverTitle = value;
        }
    }
    public int PrintQty
    {
        get
        {
            return FPrintQty;
        }
        set
        {
            FPrintQty = value;
        }
    }
}
